package com.web.cms.pan.dao;

import org.springframework.stereotype.Repository;
import com.blue.jdbc.BaseDao;
import com.web.cms.pan.model.ShareLog;

/**
 * 共享日志数据库访问
 * 
 * @author 代码由 blue-code 框架生成
 * @since 1.0 2018年04月09日
 */
@Repository("panShareLogDao")
public class ShareLogDao extends BaseDao<ShareLog>
{
	public ShareLogDao()
	{
	}
	
	@Override
	protected void query(StringBuilder sql, ShareLog param)
	{
		if (param != null)
		{
			if (param.getShareId() != null && param.getShareId() > 0)
				sql.append(" and a.share_id=:shareId");
				
			if (param.getUserId() != null && param.getUserId() > 0)
				sql.append(" and a.user_id=:userId");
				
		}
		sql.append(" order by a.id desc");
	}
	
}
